package cn.com.yx.ms.service;

import cn.com.yx.ms.application.web.ApiPager;
import cn.com.yx.ms.application.web.ApiQueryBase;
import cn.com.yx.ms.domain.dbmodel.ModelMain;
import cn.com.yx.ms.domain.dbmodel.StlDevMap;
import cn.com.yx.ms.domain.model.ModelMainModel;
import cn.com.yx.ms.domain.release.ReleaseModel;
import cn.com.yx.ms.domain.release.ReleaseStyleModel;
import cn.com.yx.ms.domain.stl.StlJmMapModel;
import cn.com.yx.ms.domain.stl.StlJmModel;
import cn.com.yx.ms.domain.stl.StlMainModel;
import cn.com.yx.ms.domain.stl.StlScModel;
import cn.yx.framework.configuration.ApiCode;
import cn.yx.framework.view.ApiResult;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 发布式样管理相关接口
 */
public interface IReleaseService {

    List<StlMainModel> findStlMain(ApiQueryBase query);

    ApiResult removeStlMain(String guids);

    ApiResult getAllModelMain(String guids);

    ApiResult addStlMain(StlMainModel stlMainModel);

    ApiResult updateStlMain(StlMainModel stlMainModel);

    ApiResult getOrgList();

    ApiResult getAllJmMain(StlJmModel stlJmModel);

    ApiResult getAllJmByControlid(String controlId, ApiQueryBase query);

    ApiResult addJmMain(StlScModel stlMainModel);

    ApiResult updateJmMain(StlJmMapModel stlJmMapModel);

    ApiResult getJmByStyleid(String styleid);

    ApiResult getAllStyles();

    ApiResult getAllJmByStyleid(String styleid);

    ApiResult getDevByStyleid(String styleid);

    List<StlDevMap> getDevsByStyleId(String styleId);

    ApiResult getScByJmid(String jmid);




    // region << 发布管理 >>

    ApiPager<ReleaseStyleModel> findPageReleaseStyles(ApiQueryBase apiQueryBase, HttpServletRequest request);

    List<ReleaseStyleModel> findReleaseStyles(ApiQueryBase apiQueryBase);

    ApiCode releaseProgram(ReleaseModel releaseModel,boolean issync) throws Exception;

    ApiCode saveProgram(ReleaseModel releaseModel) throws Exception;

    // endregion
    //找到关联设备的式样
    ApiPager<ReleaseStyleModel> findPageResleaseStylesByDevsn(ApiQueryBase query,HttpServletRequest request);
}

